package com.imy.luascript.app.ui.main.fragment.setting;

import android.view.View;
import android.widget.RelativeLayout;

import com.imy.lua.view.floating.FloatingManger;
import com.imy.luascript.R;
import com.imy.luascript.app.ui.permission.PermissionSettingActivity;
import com.imy.luascript.base.fragment.BaseLazyFragment;
import com.imy.luascript.viewmodel.BaseViewModel;
import com.suke.widget.SwitchButton;

import butterknife.BindView;
import butterknife.OnClick;

public class SettingFragment extends BaseLazyFragment {
    @BindView(R.id.debug_sb)
    SwitchButton debugSb;

    @BindView(R.id.mine_preferen_rl)
    RelativeLayout minePreferenRl;

    @Override
    protected void onLazyLoadData() {

    }

    @Override
    protected void initView(View contentView) {
        super.initView(contentView);
        debugSb.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(SwitchButton view, boolean isChecked) {
                if (isChecked) {
                    FloatingManger.get().start();
                } else {
                    FloatingManger.get().stop();
                }
            }
        });
    }

    @Override
    protected BaseViewModel getViewModel() {
        return null;
    }

    @Override
    protected int getLayoutID() {
        return R.layout.fragment_setting;
    }

    @OnClick(R.id.mine_preferen_rl)
    public void onViewClicked() {
        PermissionSettingActivity.start(self, PermissionSettingActivity.class);
    }
}
